package com.luobo.structure.decorator;

/**
 * 装饰器
 * 加蛋装饰器
 */
public class AddEggCake implements Cake {

    private Cake cake;

    public AddEggCake(Cake cake) {
        this.cake = cake;
    }

    @Override
    public String getCake() {
        return cake.getCake() + "+鸡蛋";
    }

    @Override
    public double getPrice() {
        return cake.getPrice() + 2;
    }
}
